package com.gmom.tako;

import java.util.List;

import com.gmom.tako.model.Rss;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.widget.Toast;

public class splashActivity extends Activity {	
	@Override
	protected void onCreate(Bundle savedInstanceState) {		
		super.onCreate(savedInstanceState);
		if(Intent.ACTION_SEND.equals(getIntent().getAction())){
			String url = getIntent().getExtras().getCharSequence(Intent.EXTRA_TEXT).toString();
			Toast.makeText(this, url, Toast.LENGTH_LONG).show();
			new RssUrlAdditionTask(new AsyncTaskProgress() {
				
				@Override
				public void onComplete(List<Rss> rss) {
					// TODO Auto-generated method stub
					
				}
			}, this).execute(url);
		}

		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.splash);
		Handler hdl = new Handler();
		hdl.postDelayed(new splashHandler(), 3000);
		
	}
	class splashHandler implements Runnable {
		public void run() {
			Intent i = new Intent(getApplication(), MainActivity.class);
			startActivity(i);
			splashActivity.this.finish();
		}		
	}	
}